home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / suplib / strdup.c < prev    next >
C/C++ Source or Header  |  1993-09-03  |  175b  |  15 lines

  1.  
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. char *
  6. strdup(const char *str)
  7. {
  8.     char *ptr;
  9.     
  10.     if ((ptr = malloc(strlen(str) + 1)))
  11.     strcpy(ptr, str);
  12.     return(ptr);
  13. }
  14.  
  15.